#!/bin/bash

echo "kawins 2019-1-25"

git clone https://bitbucket.org/stevengan/padavan.git
cd padavan
git checkout PSG1218

cd ..
git clone https://gitee.com/fzjar/trunk.git

rm -rf padavan/trunk/.config
mv trunk/.config padavan/trunk/
mv -rf trunk/user/www/Makefile padavan/trunk/user/www/
mv -rf trunk/user/shared/defaults.h padavan/trunk/user/shared/
mv -rf trunk/user/www/dict/CN.dict padavan/trunk/user/www/dict/
rm -rf trunk

chmod -R 777 padavan

cd padavan

cd toolchain-mipsel
./clean_sources
./build_toolchain

cd ..
cd trunk
./clear_tree
./build_firmware